package com.vinci.task.controller;

import com.vinci.task.entity.TbTaskReply;
import com.vinci.task.service.TbTaskReplyService;
import com.vinci.util.JsonObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 张先生
 * @since 2021-12-13
 */
@RestController
@RequestMapping("/task")
@Slf4j
public class TbTaskReplyController {
    @Autowired
    private TbTaskReplyService tbTaskReplyService;

    /**
     * 添加回复表
     * @param tbTaskReply
     */
    @RequestMapping("/insertTbTaskReply")
    public JsonObject insertTbTaskReply(TbTaskReply tbTaskReply, HttpSession session){
        JsonObject jsonObject = new JsonObject();
        if(tbTaskReply == null){
            jsonObject.setCode("A0400");
            jsonObject.setMsg("用户请求参数错误");
        }else {
            tbTaskReplyService.insertTbTaskReply(tbTaskReply,session);
            jsonObject.setCode("1");
            jsonObject.setMsg("成功");
        }
        return jsonObject;
    }

}

